<include file="public@header" />
</head>
<body>
<style>
    .check-container {
        display: none;
    }
    .check-container.expand-container {
        display: block;
    }
</style>

<div class="order-info">
    <!------------------- [ 基本信息 ] --------------------->
    <notempty name="empty_container">
        <div class="panel form-horizontal panel-block" data-title="提空信息">
            <div class="panel-heading">
                <div class="panel-actions">
                    <notempty name="$empty_container.receipt_no">
                        <a href="{:url('order/containerInterchangeReceipt', ['container_id' => $empty_container.id])}">设备交接单</a>
                    </notempty>
                </div>
                <span class="panel-title">提空 - {$empty_container.status|dict_convert="waybill_status",###}</span>
            </div>
            <div class="panel-body check-container <eq name='container.id' value='$empty_container.id'>expand-container</eq>">
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>订单号</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.order_no}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>委托单位</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.company_name}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>船公司</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.ship_company|dict_convert="ship_company",###}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>船名/航次</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.vessel}/{$empty_container.order.voyage_no}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>提单号</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.bl_no}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>箱型/箱量</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.container_type|dict_convert="container_type",###}/{$empty_container.order.container_num}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>预计提箱时间</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.use_time|time_format="Y-m-d H:i",###}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>提箱地点</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.use_place|dict_convert="station",###}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>备注</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.remark}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>制单时间</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.create_time|time_format="Y-m-d H:i",###}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>更新时间</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.order.update_time|time_format="Y-m-d H:i",###}</p>
                    </div>
                </div>
                <notempty name="$empty_container.waybill_no">
                    <div class="form-group col-xs-12">
                        <label class="col-xs-4 control-label"><span class="form-required"></span>运单号</label>
                        <div class="col-xs-8">
                            <p class="form-control-static">{$empty_container.waybill_no}</p>
                        </div>
                    </div>
                </notempty>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>箱号</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.container_no|default="暂未获取"}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>箱型</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.container_type}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>提箱地点</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.place_of_take|dict_convert="station",###}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>提箱时间</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$empty_container.taketime}</p>
                    </div>
                </div>
                <notempty name="$empty_container.reserve_type">
                    <div class="form-group col-xs-12">
                        <label class="col-xs-4 control-label"><span class="form-required"></span>进港时间</label>
                        <div class="col-xs-8">
                            <p class="form-control-static">
                                <if condition="($empty_container.status eq 1)">
                                    待预约
                                    <else/>
                                    {$empty_container.gateintime}
                                </if>
                            </p>
                        </div>
                    </div>
                </notempty>
                <notempty name="$empty_container.carrier_id">
                    <div class="form-group col-xs-12">
                        <label class="col-xs-4 control-label"><span class="form-required"></span>车队</label>
                        <div class="col-xs-8">
                            <p class="form-control-static">{$empty_container.carrier_company}</p>
                        </div>
                    </div>
                </notempty>
            </div>
        </div>
    </notempty>
    <!------------------- [ 基本信息 ] --------------------->
    <notempty name="loaded_container">
        <div class="panel form-horizontal panel-block" data-title="进重信息">
            <div class="panel-heading">
                <div class="panel-actions">
                </div>
                <span class="panel-title">进重 - {$loaded_container.status|dict_convert="waybill_status",###}</span>
            </div>
            <div class="panel-body check-container <eq name='container.id' value='$loaded_container.id'>expand-container</eq>">
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>箱号</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.container_no|default="暂未获取"}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>落箱点</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.place_of_specify}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>订单号</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.order.order_no}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>委托单位</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.order.company_name}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>船公司</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.order.ship_company|dict_convert="ship_company",###}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>船名/航次</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.order.vessel}/{$loaded_container.order.voyage_no}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>提单号</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.order.bl_no}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>箱型</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.order.container_type}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>备注</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.order.remark}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>制单时间</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.order.create_time|time_format="Y-m-d H:i",###}</p>
                    </div>
                </div>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>更新时间</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.order.update_time|time_format="Y-m-d H:i",###}</p>
                    </div>
                </div>
                <notempty name="$loaded_container.waybill_no">
                    <div class="form-group col-xs-12">
                        <label class="col-xs-4 control-label"><span class="form-required"></span>运单号</label>
                        <div class="col-xs-8">
                            <p class="form-control-static">{$loaded_container.waybill_no}</p>
                        </div>
                    </div>
                </notempty>
                <div class="form-group col-xs-12">
                    <label class="col-xs-4 control-label"><span class="form-required"></span>箱型</label>
                    <div class="col-xs-8">
                        <p class="form-control-static">{$loaded_container.container_type}</p>
                    </div>
                </div>
                <notempty name="$loaded_container.reserve_type">
                    <div class="form-group col-xs-12">
                        <label class="col-xs-4 control-label"><span class="form-required"></span>进港时间</label>
                        <div class="col-xs-8">
                            <p class="form-control-static">
                                <if condition="($loaded_container.status eq 1)">
                                    待预约
                                    <else/>
                                    {$loaded_container.gateintime}
                                </if>
                            </p>
                        </div>
                    </div>
                </notempty>
                <notempty name="$loaded_container.carrier_id">
                    <div class="form-group col-xs-12">
                        <label class="col-xs-4 control-label"><span class="form-required"></span>车队</label>
                        <div class="col-xs-8">
                            <p class="form-control-static">{$loaded_container.carrier_company}</p>
                        </div>
                    </div>
                </notempty>
            </div>
        </div>
    </notempty>
</div>
<notempty name="Think.get.user_id">
    <div class="page-foot fixed">
        <switch name="container.status">
            <case value="1">
                <a class="btn btn-primary popup-url" data-max="true" data-title="进港时间预约" data-url="{:url('order/reserve', ['container_id' => $container.id, 'reserve_type' => $container.order_type, 'user_id' => $Think.get.user_id, 'car_no' => $Think.get.car_no])}" data-width="320" href="javascript:void(0);">{$container.reserve_type|dict_convert="reserve_type",###}</a>
            </case>
            <case value="9">
                <a class="btn btn-primary accept" data-max="true" href="javascript:void(0);">确定接单</a>
            </case>
            <default />
            <notempty name="container.container_no">
                <!--<a class="btn popup-url" data-max="true" data-title="预录入" data-url="{:url('order/reserve', ['container_id' => $empty_container.id])}" data-width="320" href="javascript:void(0);">预录入</a>-->
            </notempty>
        </switch>
    </div>
</notempty>
<script src="__STATIC__/js/api.js"></script>
<script>
    $('.accept').click(function () {
        $.post('{:url("order/waybillReceiveViaScan", ["id" => $id, "user_id" => $user_id, "car_no" => $car_no])}', function (result) {
//            window.parent.window.location.reload();
            //回调关闭android端页面的方法
            // 由于对象映射，所以调用closeUtils对象等于调用Android映射的对象
            closeUtils.closeActivity(result);
        });
    });
    $('.panel-heading').click(function () {
        $(this).next().toggleClass('expand-container');
    });
</script>
<style>
    .control-label { text-align: right; }
    .col-xs-8 { padding-left: 5px; padding-right: 5px; }
    .form-group {
        margin-bottom: 0;
    }
    .page-foot.fixed {
        position: fixed;
        bottom: 0;
        width: 100%;
        text-align: center;
        line-height: 50px;
        background: #fff;
        border-top: 1px solid #d7d7d7;
    }
</style>
</body>
</html>